package com.openbravo.pos.inventory.model;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;

import com.openbravo.bean.ProductAttributeValuePrice;
import com.openbravo.format.Formats;
import com.openbravo.pos.base.AppLocal;

public class ProductAttributeValuePriceTableModel extends AbstractDTOTableModel<ProductAttributeValuePrice>{

    public String[] getColumnNames() {
        return new String[] {
        AppLocal.getIntString("label.ProductPrice.groupName"),
        AppLocal.getIntString("label.prodpricesell"),
        AppLocal.getIntString("label.prodpricebuy")
        };
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
    	ProductAttributeValuePrice p=getObj(rowIndex);
         switch(columnIndex){
             case 0:
                 return p.getAttname();
             case 1:
                 return Formats.CURRENCY.formatValue(p.getDiffprice());
             case 2:
            	 return Formats.CURRENCY.formatValue(p.getDiffPriceCost());
         }
         return null;
    }
}